package com.xc.hotelmgr.fegin.controller;

import com.alibaba.fastjson.JSONObject;
import com.xc.hotelmgr.fegin.pojo.DelRp;
import com.xc.hotelmgr.fegin.pojo.SendAllList;
import com.xc.hotelmgr.fegin.pojo.UpDownList;
import com.xc.hotelmgr.fegin.service.MtFeginService;
import com.xc.hotelmgr.fegin.utils.ComResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
public class MtFeignController {

    @Autowired
    private MtFeginService mtFeginService;

    @RequestMapping(value = "/mt/rates", method = RequestMethod.POST)
    public ComResult callbackRs(@RequestBody JSONObject jsonObject) {
        boolean result = mtFeginService.callbackRs(jsonObject);
        if(result) {
            return new ComResult(0, "成功");
        }
        return new ComResult(1, "成功");
    }

    @RequestMapping(value = "/mt/rps", method = RequestMethod.POST)
    public ComResult callbackRp(@RequestBody JSONObject jsonObject){
        boolean result = mtFeginService.callbackRp(jsonObject);
        if(result) {
            return new ComResult(0, "成功");
        }
        return new ComResult(1, "成功");
    }

    @RequestMapping(value = "/mt/hts", method = RequestMethod.POST)
    public ComResult callbackHotrl(@RequestBody JSONObject jsonObject){
        boolean result = mtFeginService.callbackHotel(jsonObject);
        if(result) {
            return new ComResult(0, "成功");
        }
        return new ComResult(1, "成功");
    }

}
